<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<script type="text/javascript" src="../js/jquery-1.8.3.js"></script>

<script type="text/javascript">
	$(document).ready(function(){
		$('#subbtn').click(function(){
			var name = $('#idUserName').val();	
			var password = $('#password').val();	
			var sex = $('input:radio:checked').val();	
			var name = $('#idUserName').val();	
			if(name != ""){
					$('#userNameErrSpan').hide();
			}
			if(password != ""){
				$('#userPwdErrSpan').hide();
			}
			alert(sex);
			if(sex != ""){
				$('#userSexErrSpan').hide();
			}
			//$('#formit').submit();
		});
	});
	
	
// 	function subfunc(){
// 		document.getElementById("formit").submit();
// 	}
	
</script>


<body>
	
  <form id="formit" name="formName" action="success.html" method="get">
	     <table border="1" cellpadding="5" cellspacing="0">
	    	<caption>新增用户 </caption>
	    	<tr>	    		
	    		<td>姓名：</td>
	    		<td><input id="idUserName" type="text" name="userName"  label='输入姓名' />&nbsp;<span style="color:red"></span>&nbsp;<span id="userNameErrSpan" style="color:red">*</span></td>
	    	</tr>
	    	<tr>	    		
	    		<td>密码：</td>
	    		<td><input id="password" type="password" name="userPwd"/>&nbsp;<span style="color:red"></span>&nbsp;<span id="userPwdErrSpan" style="color:red">*</span></td>
	    	</tr>
	    	<tr>	    		
	    		<td>性别：</td>
	    		<td><input type="radio" name="userSex" value="0" sexLabel="男" label="性别：男">男
	    		    <input type="radio" name="userSex" value="1" sexLabel="女" >女&nbsp;<span style="color:red"></span>&nbsp;<span id="userSexErrSpan" style="color:red">*</span></td>
	    	</tr>
	    	<tr>    		
	    		<td>爱好：</td>
	    		<td><input type="checkbox" name="userRelax" value="0">游泳
	    		    <input type="checkbox" name="userRelax" value="1" >阅读
	    		    <input type="checkbox" name="userRelax" value="2">篮球&nbsp;<span style="color:red">*</span>&nbsp;<span id="userRelaxErrSpan" style="color:red"></span></td>    		
	    	</tr>
	    	<tr>    		
	    		<td>职业：</td>
	    		<td>
	    			<select name="userJob" > <!--  size="10" multiple="true"-->
	    				<option value="">请选择职业 </option>
	    				<option value="10" >护士 </option>
	    				<option value="20">医生</option>
	    				<option value="30">教师 </option>
	    				<option value="40">自由职业 </option>
	    		    </select>
	    		    &nbsp;<span style="color:red">*</span>&nbsp;<span id="userJobErrSpan" style="color:red"></span>
	    		 </td>    		
	    	</tr>
	    	<tr>
	    		<td>头像：</td>
	    		<td><input type="file" name="userFace" accept="image/*"/></td>
	    		
	    	</tr>
	    	<tr>
	    		<td>备注：</td>
	    		<td><textarea name="bz" cols="100" rows="10">备注内容</textarea></td>
	    		
	    	</tr>
	    	<tr>
	    		<td colspan="2" align="center">
	    		<input id="subbtn" type="button" value="提交" onclick="subfunc()"/>
	    		<input type="reset" value="重置"/>
	    		</td>
	    		
	    	</tr>	    	
	    </table>
	    
  </form> 
    
</body>
</html>